package com.du.enums;


import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

/**
 * @Desc :
 * @Author: shuangdu
 * @date : 2024/4/29
 */
public enum RenderSelectItem {

    TO_MARKDOWN(1, "mysql转为markdown"),
    TO_BEAN(2, "mysql转为java bean"),
    TO_YAML(3, "properties转为yml"),
    TO_PROPERTIES(4, "yml转为properties"),
    ;

    public final int key;
    public final String name;

    RenderSelectItem(int key, String name){
        this.key = key;
        this.name = name;
    }

    private static Map<Integer, RenderSelectItem> map = new HashMap<>();

    public static RenderSelectItem getEnum(int key) {
        return map.get(key);
    }

    static {
        Arrays.stream(values()).forEach(i -> map.put(i.key, i));
    }
}
